/**
 * 
 */
package com.myBase.core.facade.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.myBase.core.dao.GoldcoinRelateRulesDao;
import com.myBase.core.entity.GoldcoinRelateRules;
import com.myBase.core.entity.GoldcoinRelateRulesVo;
import com.myBase.core.facade.service.GoldcoinRelateRulesServiceFacade;
import com.myBase.common.persistence.Page;
import com.myBase.common.service.CrudAbstractService;

/**
 * 金币相关规则Service
 * @author 金币相关规则
 * @version 2017-05-17
 */
@Service("goldcoinRelateRulesServiceFacade")
@Transactional(readOnly = true)
public class GoldcoinRelateRulesServiceImpl extends CrudAbstractService<GoldcoinRelateRulesDao, GoldcoinRelateRules>
        implements GoldcoinRelateRulesServiceFacade {

    @Autowired
    GoldcoinRelateRulesDao goldcoinRelateRulesDao;

    public GoldcoinRelateRules get(String id) {
        return super.get(id);
    }

    public List<GoldcoinRelateRules> findList(GoldcoinRelateRules goldcoinRelateRules) {
        return super.findList(goldcoinRelateRules);
    }

    public Page<GoldcoinRelateRules> findPage(Page<GoldcoinRelateRules> page, GoldcoinRelateRules goldcoinRelateRules) {
        return super.findPage(page, goldcoinRelateRules);
    }

    @Transactional(readOnly = false)
    public void save(GoldcoinRelateRules goldcoinRelateRules) {
        goldcoinRelateRulesDao.insert(goldcoinRelateRules);
    }

    @Transactional(readOnly = false)
    public void delete(GoldcoinRelateRules goldcoinRelateRules) {
        super.delete(goldcoinRelateRules);
    }

    @Override
    @Transactional(readOnly = false)
    public void save(List<GoldcoinRelateRules> list) {
        for (GoldcoinRelateRules goldcoinRelateRules : list) {
            goldcoinRelateRulesDao.insert(goldcoinRelateRules);
        }
    }

    @Override
    public List<GoldcoinRelateRulesVo> getGoinDistributionInfo(String goldcoinid) {
        List<GoldcoinRelateRulesVo> list = goldcoinRelateRulesDao.getGoinDistributionInfo(goldcoinid);
        return list;
    }

}